package com.example.pro1.controller.zhao;

import io.swagger.annotations.Api;

import org.apache.http.HttpRequest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Api(tags = "session")
@RestController
@RequestMapping("/api/session")
public class session {
    @GetMapping("/log")
    public void getsession(HttpServletRequest httpRequest, @RequestParam("user") String user)
    {
        HttpSession s=httpRequest.getSession();
        s.setAttribute("user",user);
        return;
    }
}
